An elevator comprises an elevator car, lifting machinery, ropes, and a counterweight. The elevator car is supported on a transport frame being formed by a sling or a car frame. The sling surrounds the elevator car. The lifting machinery moves the car upwards and downwards in a vertically extending elevator shaft. The sling and thereby also the elevator car are carried by the ropes, which connect the elevator car to the counterweight. The sling is further supported with gliding means at guide rails extending in the vertical direction in the elevator shaft. The gliding means can comprise rolls rolling on the guide rails or gliding shoes gliding on the guide rails when the elevator car is mowing upwards and downwards in the elevator shaft. The guide rails are supported with fastening means on the side wall structures of the elevator shaft. The gliding means engaging with the guide rails keep the elevator car in position in the horizontal plane when the elevator car moves upwards and downwards in the elevator shaft. The counterweight is supported in a corresponding way on guide rails supported with fastening means on the wall structure of the elevator shaft. The elevator car transports people and/or goods between the landings in the building. The elevator shaft can be formed so that one or several of the side walls are formed of solid walls and/or so that one or several of the side walls are formed of an open steel structure. The guide rails are formed of guide rail elements of a certain length.